/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author ODHeroes
 */
@Entity
@Table(name = "establishments_probes")
@NamedQueries({
    @NamedQuery(name = "EstablishmentsProbes.findAll", query = "SELECT e FROM EstablishmentsProbes e"),
    @NamedQuery(name = "EstablishmentsProbes.findByEstablishmentProbesId", query = "SELECT e FROM EstablishmentsProbes e WHERE e.establishmentProbesId = :establishmentProbesId"),
    @NamedQuery(name = "EstablishmentsProbes.findByAddress", query = "SELECT e FROM EstablishmentsProbes e WHERE e.address = :address"),
    @NamedQuery(name = "EstablishmentsProbes.findByCityId", query = "SELECT e FROM EstablishmentsProbes e WHERE e.cityId = :cityId"),
    @NamedQuery(name = "EstablishmentsProbes.findByCode", query = "SELECT e FROM EstablishmentsProbes e WHERE e.code = :code"),
    @NamedQuery(name = "EstablishmentsProbes.findByCreatedAt", query = "SELECT e FROM EstablishmentsProbes e WHERE e.createdAt = :createdAt"),
    @NamedQuery(name = "EstablishmentsProbes.findByLatitude", query = "SELECT e FROM EstablishmentsProbes e WHERE e.latitude = :latitude"),
    @NamedQuery(name = "EstablishmentsProbes.findByLongitude", query = "SELECT e FROM EstablishmentsProbes e WHERE e.longitude = :longitude"),
    @NamedQuery(name = "EstablishmentsProbes.findByName", query = "SELECT e FROM EstablishmentsProbes e WHERE e.name = :name"),
    @NamedQuery(name = "EstablishmentsProbes.findByPhone", query = "SELECT e FROM EstablishmentsProbes e WHERE e.phone = :phone"),
    @NamedQuery(name = "EstablishmentsProbes.findByUpdatedAt", query = "SELECT e FROM EstablishmentsProbes e WHERE e.updatedAt = :updatedAt")})
public class EstablishmentsProbes implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "establishment_probes_id")
    private BigDecimal establishmentProbesId;
    @Size(max = 256)
    @Column(name = "address")
    private String address;
    @Size(max = 256)
    @Column(name = "city_id")
    private String cityId;
    @Size(max = 256)
    @Column(name = "code")
    private String code;
    @Column(name = "created_at")
    @Temporal(TemporalType.DATE)
    private Date createdAt;
    @Column(name = "latitude")
    private BigInteger latitude;
    @Column(name = "longitude")
    private BigInteger longitude;
    @Size(max = 256)
    @Column(name = "name")
    private String name;
    // @Pattern(regexp="^\\(?(\\d{3})\\)?[- ]?(\\d{3})[- ]?(\\d{4})$", message="Invalid phone/fax format, should be as xxx-xxx-xxxx")//if the field contains phone or fax number consider using this annotation to enforce field validation
    @Size(max = 256)
    @Column(name = "phone")
    private String phone;
    @Column(name = "updated_at")
    @Temporal(TemporalType.DATE)
    private Date updatedAt;
    @JoinColumn(name = "establishment_id", referencedColumnName = "establishment_id")
    @ManyToOne(optional = false)
    private Establishments establishmentId;
    @JoinColumn(name = "product_probes_id", referencedColumnName = "product_probes_id")
    @ManyToOne(optional = false)
    private ProductProbes productProbesId;
    @JoinColumn(name = "states_id", referencedColumnName = "states_id")
    @ManyToOne(optional = false)
    private States statesId;

    public EstablishmentsProbes() {
    }

    public EstablishmentsProbes(BigDecimal establishmentProbesId) {
        this.establishmentProbesId = establishmentProbesId;
    }

    public BigDecimal getEstablishmentProbesId() {
        return establishmentProbesId;
    }

    public void setEstablishmentProbesId(BigDecimal establishmentProbesId) {
        this.establishmentProbesId = establishmentProbesId;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getCityId() {
        return cityId;
    }

    public void setCityId(String cityId) {
        this.cityId = cityId;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public BigInteger getLatitude() {
        return latitude;
    }

    public void setLatitude(BigInteger latitude) {
        this.latitude = latitude;
    }

    public BigInteger getLongitude() {
        return longitude;
    }

    public void setLongitude(BigInteger longitude) {
        this.longitude = longitude;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Date getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(Date updatedAt) {
        this.updatedAt = updatedAt;
    }

    public Establishments getEstablishmentId() {
        return establishmentId;
    }

    public void setEstablishmentId(Establishments establishmentId) {
        this.establishmentId = establishmentId;
    }

    public ProductProbes getProductProbesId() {
        return productProbesId;
    }

    public void setProductProbesId(ProductProbes productProbesId) {
        this.productProbesId = productProbesId;
    }

    public States getStatesId() {
        return statesId;
    }

    public void setStatesId(States statesId) {
        this.statesId = statesId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (establishmentProbesId != null ? establishmentProbesId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EstablishmentsProbes)) {
            return false;
        }
        EstablishmentsProbes other = (EstablishmentsProbes) object;
        if ((this.establishmentProbesId == null && other.establishmentProbesId != null) || (this.establishmentProbesId != null && !this.establishmentProbesId.equals(other.establishmentProbesId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Model.EstablishmentsProbes[ establishmentProbesId=" + establishmentProbesId + " ]";
    }
    
}
